<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/user/common.jsp"%>
<%@ page import="com.bci.pwtz.common.util.SpringUtil" %>
<%@ page import="com.bci.pwtz.service.DyxlService" %>
<%@ page import="com.bci.pwtz.service.DypdxService" %>
<%@ page import="com.bci.pwtz.service.DydlfjxService" %>
<%@ page import="com.bci.pwtz.mysql.model.Dyxl" %>
<%@ page import="com.bci.pwtz.mysql.model.Dydlfjx" %>
<%@ page import="com.bci.pwtz.mysql.model.Dypdx" %>
<%
Long companyId=null;
if(user!=null){
    companyId=user.getLastCompanyId();
}
int devicetype=Integer.valueOf(request.getParameter("devicetype"));
String deviceid=request.getParameter("deviceid");
//deviceid="a1de9189-6453-4647-b08e-10c46daf6201";
//int devicetype=16;
DyxlService lineservice=(DyxlService)SpringUtil.getBean("dyxlService");
DypdxService dypdxservice=(DypdxService)SpringUtil.getBean("dypdxService");
DydlfjxService dydlfjxservice=(DydlfjxService)SpringUtil.getBean("dydlfjxService");
String linename="";
String linecode="";
String devicename="";
String stationname="";
String stationtype="";
String transformercode="";
String dbyqtype="";
String byqname="";
int byqtype=0;
Dyxl line=new Dyxl();
if(devicetype==16){
    Dypdx device=dypdxservice.load(deviceid);
    line=lineservice.load(device.getLinecode());
    if(line!=null){
        transformercode=line.getTransformercode();
        byqtype=line.getDevicetype();
        linecode=line.getDeviceid();
        if(byqtype==1){
            byqname="配电变压器";
            dbyqtype="pdbyq";
        }else{
            byqname="柱上变压器";
            dbyqtype="zsbyq";
        }
    }
    stationtype="dypdx";
    stationname="低压配电箱";
}else{
    Dydlfjx device=dydlfjxservice.load(deviceid);
    line=lineservice.load(device.getLinecode());
    if(line!=null){
        transformercode=line.getTransformercode();
        byqtype=line.getDevicetype();
        linecode=line.getDeviceid();
        if(byqtype==1){
            byqname="配电变压器";
            dbyqtype="pdbyq";
        }else{
            byqname="柱上变压器";
            dbyqtype="zsbyq";
        }
    }
    stationtype="dydlfjx";
    stationname="低压电缆分接箱";
}
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据-低压母线</title>
<link href="<%=basePath %>user/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>user/css/llcss.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>js/toolutils.js"></script>
<script type="text/javascript" src="<%=basePath %>js/ajaxfileupload.js"></script>
<script type="text/javascript">
var companyId=<%=companyId%>;
var stationcode='<%=deviceid%>';
var devicetype=<%=devicetype%>;
var model;
var productionfactory;
</script>
<script type="text/javascript" src="<%=basePath %>user/d/js/dymxadd.js"></script>
</head>
<body bgcolor="white">
	<%@ include file="/user/head.jsp"%>
	<!-- main_begin -->
	<div class="pwsj_cont_box">
	<%@ include file="/user/left.jsp"%>
	<!-- 右侧内容_begin -->
	<form id="form">
		<div class="pwsj_cont_right_box" scroll="no">
		<!-- 柱上变压器_begin -->
		<div class="pwsj_right_byq" scroll="no">
			<div class="pwsj_right_byq_position" style="margin-bottom:3px;">
				<a href="<%=basePath %>user/m/index.jsp" class="position">配网数据</a>&gt;
				<a href="<%=basePath %>user/d/<%=dbyqtype %>list.jsp" class="position"><%=byqname %></a>&gt;
				<a href="<%=basePath %>user/d/dyxllist.jsp?deviceid=<%=transformercode %>&devicetype=<%=byqtype %>" class="position">低压线路</a>&gt;
				<a href="<%=basePath %>user/d/<%=stationtype %>list.jsp?deviceid=<%=linecode %>" class="position"><%=stationname %></a>&gt;
				<a  class="position">添加低压母线</a>
				<a class="right" href="<%=basePath%>user/d/dymxlist.jsp?deviceid=<%=deviceid%>&devicetype=<%=devicetype%>&t=<%=System.currentTimeMillis() %>">返回</a><a class="right"  onclick="add()">保存</a>
			</div>
			<!-- 运行参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">运行参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>设备名称：</span><input class="text" type="text" value="<%=devicename%>母线" id="devicename" name="devicename" maxlength="100"/><em style="color:red;"> *</em></li>
						<li class="argument_cont_li"><span>运行编号：</span><input class="text" type="text" id="devicenumber" name="devicenumber"/></li>
						<%if(devicetype==16){
							Dypdx device=dypdxservice.load(deviceid);
							linecode=device.getLinecode();
							line=lineservice.load(linecode);
							linename=line.getDevicename();
							devicename=device.getDevicename();
							%>
							<li class="argument_cont_li"><span>所属线路名称：</span><input class="text" type="hidden" id="linecode" name="linecode" value="<%=linecode%>"/><input class="text" type="text" disabled="disabled" value="<%=linename%>"/><!-- <em style="color:red;"> *</em> --></li>
						<%}else{ 
						    Dydlfjx device=dydlfjxservice.load(deviceid);
							linecode=device.getLinecode();
							line=lineservice.load(linecode);
							linename=line.getDevicename();
							devicename=device.getDevicename();
						%>
							<li class="argument_cont_li"><span>所属线路名称：</span><input class="text" type="hidden" id="linecode" name="linecode" value="<%=linecode%>"/><input class="text" type="text" disabled="disabled" value="<%=linename%>"/><!-- <em style="color:red;"> *</em> --></li>
						<%} %>						
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<%if(devicetype==16){ %>
							<li class="argument_cont_li"><span>所属站房类型：</span><input class="text" type="text" disabled="disabled"  value="低压配电箱"/><input class="text" type="hidden" name="stationdevicetype" value="16"/></li>
						<%}else{ %>
							<li class="argument_cont_li"><span>所属站房类型：</span><input class="text" type="text" disabled="disabled"  value="低压电缆分接箱"/><input class="text" type="hidden" name="stationdevicetype"  value="17"/></li>
						<%} %>
						<li class="argument_cont_li"><span>所属站房：</span><input class="text" type="text" readonly="readonly" value="<%=devicename%>"/><input class="text" type="hidden" name="stationcode" value="<%=deviceid%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li"><span>所属地市：</span><input class="text" type="text" id="localcity" name="localcity" value="<%=line.getLocalcity()%>"/><!-- <em style="color:red;"> *</em> --></li>					
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>运维单位：</span><input class="text" type="text" id="operationunit" name="operationunit" value="<%=line.getOperationunit()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li"><span>维护班组：</span><input class="text" type="text" id="maintenanceteam" name="maintenanceteam"value="<%=line.getMaintenanceteam()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>电压等级：</span>
							<select class="select_down" id="voltagelevel" name="voltagelevel">
								<option value="380v">380v</option>
								<option value="220v">220v</option>
							</select>
							<script>setDefault("voltagelevel","<%=line.getVoltagelevel()%>")</script>
							<!-- <em style="color:red;"> *</em> -->
						</li>							
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li" style="position:relative;"><span>投运日期：</span><input class="text" type="text"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="commissioningdate"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li">
							<span>运行状态：</span>
							<select class="select_down" name="operationstate">  
								<option value ="正常" selected="selected">正常</option>  
								<option value ="异常">异常</option>
								<option value ="故障">故障</option>
								<option value ="缺陷">缺陷</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>	
						<li class="argument_cont_li">
							<span>设备状态：</span>
							<select class="select_down" name="equipmentstate">  
								<option value ="在运" selected="selected">在运</option>  
								<option value ="未投运">未投运</option>
								<option value ="退役">退役</option>
								<option value ="现场留用">现场留用</option>
								<option value ="库存备用">库存备用</option>
								<option value ="待报废">待报废</option>
								<option value ="报废">报废</option>
								<option value ="正常">正常</option>
								<option value ="异常">异常</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>所属盘柜：</span><input class="text" type="text" name="diskcabinet"/></li>
						<li class="argument_cont_li"><span>设备主人：</span><input class="text" type="text" name="equipmentowner"/><!-- <em style="color:red;"> *</em> --></li>
						<div class="clear"></div>
					</ul>
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 运行参数_end -->

			<!-- 物理参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">物理参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>型号：</span>
							<select class="select_down" id="model" name="model">  
								<option value ="" selected="selected">--型号--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('型号',19001,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li"><span>生产厂家：</span>
							<select class="select_down" id="productionfactory" name="productionfactory">  
								<option value ="" selected="selected">--生产厂家--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('生产厂家',19002,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li" style="position:relative;"><span>出厂日期：</span><input class="text" type="text"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="factorydate"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /></li>							
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>出厂编号：</span><input class="text" type="text" name="serialnumber"/></li>
						<li class="argument_cont_li"><span>母线长度：</span><input class="text" type="text" name="length" value="0.0"/></li>
						<li class="argument_cont_li">
							<span>母线材质：</span>
							<select class="select_down" name="busbarmaterial">
								<option value="铜" selected="selected">铜</option>
								<option value="铝">铝</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li><div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>截面规格：</span><input class="text" type="text" name="sectionalspecification"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li"><span>截面载流量：</span><input class="text" type="text" name="busbarcarryingcapacity" value="0.0"/><!-- <em style="color:red;"> *</em> --></li>
						<div class="clear"></div>
					</ul>		
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 物理参数_end -->
		</div>	
		<!-- 柱上变压器_end -->		
	</div>
	</form>
	<!-- 右侧内容_end -->
	<div class="clear"></div><!-- 清除左右浮动 -->
	</div>
	<!-- main_end -->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>